package com.bwstudio.demo.consumer;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.bwstudio.demo.provider.api.HelloService;

@RestController
@SpringBootApplication
@EnableDiscoveryClient
public class Application {

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

	@Reference
	HelloService helloService;

	@GetMapping("/hello")
	public String syncHello() {
		return helloService.hello("Hello World!");
	}
	
}
